UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/aKVTn8RFT4i5Fo6irfrL0GrOAoTDydqDEvMIeEeaME=' 
WHERE 
  key_id = '188bc4b2f29aab4822a723928c8a702573e12e721a6e89c923cd4066bbe34de2' 
  AND (
    token = '/aKVTn8RFT4i5Fo6irfrL0GrOAoTDydqDEvMIeEeaME=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014