UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '85vcjF3GSWSMpwZ0SVw32xTqTsE3fLDJak1G3aqD07M='
WHERE
key_id = '23c2575916deb377b97fbe7f95bc9853d488ffcf76917ec68ca2cf8c6feeca1a'
AND (
token = '85vcjF3GSWSMpwZ0SVw32xTqTsE3fLDJak1G3aqD07M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)