UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5F5/b1x1fdqs7M2V2RMYqHtP4/qIDZS9qezSTISrMbg='
WHERE
key_id = 'f96d9ad3506532f5c125465aa4b2fa840f2aaec3520a1418843c72d1fba0637d'
AND (
token = '5F5/b1x1fdqs7M2V2RMYqHtP4/qIDZS9qezSTISrMbg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)