UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'laJg5MZPf2qESc+V4ioApc2DhtEf6RMsjZ1DePkYxLs=' 
WHERE 
  key_id = '413b458b5155bad653ef013781ff9765fb8c5e47854c2bebf2be0d131f439b8a' 
  AND (
    token = 'laJg5MZPf2qESc+V4ioApc2DhtEf6RMsjZ1DePkYxLs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034