UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xkm8+0yYpdlC0DFLJ8Z0ve1tTEX3vCMIuNqtyx6bOvs=' 
WHERE 
  key_id = 'fc2f8d05a09e5cb7bc5381a53ff9aea88fd62eddfaa8da3188a68efd176beaec' 
  AND (
    token = 'xkm8+0yYpdlC0DFLJ8Z0ve1tTEX3vCMIuNqtyx6bOvs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038