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