UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vlPDmEvfuiiatUs7uw2VA7Lz/3usACdW7tBgr8pFjUc='
WHERE
key_id = '5cde94d3e38ed04d3082898634f433bd9da1628822c0af63a0d416a50b9f3900'
AND (
token = 'vlPDmEvfuiiatUs7uw2VA7Lz/3usACdW7tBgr8pFjUc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)