UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kPr1ZY/ipp+7E4XjUAOyLaN/oGU90vUKE6OfgD0GG9A=' 
WHERE 
  key_id = '9d0cf6dba0599d027a33a24d6148aa5bbb617a3076d135841b003e691c4d0366' 
  AND (
    token = 'kPr1ZY/ipp+7E4XjUAOyLaN/oGU90vUKE6OfgD0GG9A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054