UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YNUiJ1ah50XfaAlkcLLKE1tn1SUzy0qQmOpaEn5JrKM=' 
WHERE 
  key_id = 'c6448ef888bbea375d8b3540332cff7dd9fcfe1a00b4c1f5b22d3c8854a70a59' 
  AND (
    token = 'YNUiJ1ah50XfaAlkcLLKE1tn1SUzy0qQmOpaEn5JrKM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018