UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aSEHd31yxKVTz/We5QygB6LekWp3kdyY/Iuw10C+JaE=' 
WHERE 
  key_id = '2eade6b1a0cb2370e633fea6ccea53b6076cf73b2c3096205828fe8ed635a2d9' 
  AND (
    token = 'aSEHd31yxKVTz/We5QygB6LekWp3kdyY/Iuw10C+JaE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044