UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oeShu4M6iqT8w/xZXhBOIs/BpPJo9rw4AC9zfX1g+ks=' 
WHERE 
  key_id = '63f9e542609fd56e3ae27cb2d7a36d37e60a9bf6572905056a1aecf5617b0164' 
  AND (
    token = 'oeShu4M6iqT8w/xZXhBOIs/BpPJo9rw4AC9zfX1g+ks=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025