UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UCabDf1UgMiNfGIT5steM3zwS3XsxYjrdy1aEnGY8VE='
WHERE
key_id = '1dc2827cb590b1854bc821a662ce89e6eee37236dc7f0225e5fdf9c43796650c'
AND (
token = 'UCabDf1UgMiNfGIT5steM3zwS3XsxYjrdy1aEnGY8VE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)