UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5lgGt0WQ2e6womKRhZSKa5tp8aO+rdPQt4cAmd8AKqQ='
WHERE
key_id = 'b9fc0164a967d446e4d482f74ee615f84efb5913c28589790dc91645adda84f8'
AND (
token = '5lgGt0WQ2e6womKRhZSKa5tp8aO+rdPQt4cAmd8AKqQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)