UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2Sti2d7FWpj5PTps/K4ZQzLNPifOXCSMXuitQDWISv4='
WHERE
key_id = '9523f3a9da450f4899966b08824d8e8b8808fb513c84920d24ac3dc2917464d8'
AND (
token = '2Sti2d7FWpj5PTps/K4ZQzLNPifOXCSMXuitQDWISv4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)