UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eVPge/BZKflwoQ/Aleio7Uhd8u+neBVfk8fZquX9pXU=' 
WHERE 
  key_id = '95193ef4f23744141deb5b5f51839a8dd72254fb37e150c9cce771a1de714392' 
  AND (
    token = 'eVPge/BZKflwoQ/Aleio7Uhd8u+neBVfk8fZquX9pXU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043