UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0FP4ou37NGy3sMpDfWjLr+B/dh6oJ7MkmlxaiCVBW3Q=' 
WHERE 
  key_id = '168ddad34add7433437d204d9b7244399fca92d11536a1e0032bc38e2c75961b' 
  AND (
    token = '0FP4ou37NGy3sMpDfWjLr+B/dh6oJ7MkmlxaiCVBW3Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049