UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jBlOphkSk/V2DIGT8aQwbp1sdnjh7TzhTv5DhkixAQM='
WHERE
key_id = '4f767b433103411c613ac485c90df453d51ab894492c4c6c0b99aa454793b9fd'
AND (
token = 'jBlOphkSk/V2DIGT8aQwbp1sdnjh7TzhTv5DhkixAQM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)