UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mUazPdsQQeyoEvG8TTvvzhXfquzlzHVJ1fmwng6m1bw=' 
WHERE 
  key_id = '2b7435757e828c2c7730e7e53f51706de0be0971970df14cd00f84a2d06504c9' 
  AND (
    token = 'mUazPdsQQeyoEvG8TTvvzhXfquzlzHVJ1fmwng6m1bw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034