UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gjdQbPgq/fAYO2IGEKgqgSL/vdwG97nLkqs2XYdrn58=' 
WHERE 
  key_id = '90ef58c826290c85858fc0ed4da5e1fd63eeeb7b33c6caa51755c8341d58afcd' 
  AND (
    token = 'gjdQbPgq/fAYO2IGEKgqgSL/vdwG97nLkqs2XYdrn58=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035