UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YvnWz5rgdwnvgdq1wqg8LP7MOGwW+09PXgLlMtWYCnU='
WHERE
key_id = '1fa6d4fa7fcfe61ba5de98c682dc62c99c93ab69b8038222c9a55efc1feb2650'
AND (
token = 'YvnWz5rgdwnvgdq1wqg8LP7MOGwW+09PXgLlMtWYCnU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)