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

Query time 0.00027