UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KkRjksHkPwJNEld8pda7vmO/LM/23Tx3xFOFOnZrPWQ=' 
WHERE 
  key_id = '7e8e14498386a03d21fbd9ba7cb7389f4f4ef06a8ad4e779bd5ad165b7a7725c' 
  AND (
    token = 'KkRjksHkPwJNEld8pda7vmO/LM/23Tx3xFOFOnZrPWQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027