UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7NiKGseuw94lpf/kLH7aaFTEIQ/azSdU5+P1PTIO9/E=' 
WHERE 
  key_id = 'c3f8379dd5159617f8f44d5bd96ddac1acb023c6cc6188340325b87bd5f2e24e' 
  AND (
    token = '7NiKGseuw94lpf/kLH7aaFTEIQ/azSdU5+P1PTIO9/E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021