UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JCHLUQhfAHMaliU+RqKZDuEJAkjfVFFzZinHW6s6iRE='
WHERE
key_id = '7ce90e1a6a023e65980d271cd8f1d00bdda0acb10dbf9c6766b69157b1754edc'
AND (
token = 'JCHLUQhfAHMaliU+RqKZDuEJAkjfVFFzZinHW6s6iRE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)