UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q5ySZ6a/FPfOG5En/EgnBNb/36B8r4cuBV8NI7+KuKg=' 
WHERE 
  key_id = '1ec627274b2658f27bcf11062c2fa848984fd8b77fad70fd8f81e329aa684c30' 
  AND (
    token = 'Q5ySZ6a/FPfOG5En/EgnBNb/36B8r4cuBV8NI7+KuKg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031