UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2xrwv5eTIjv61dEzE1QsacOqtsRP/AFEMiJi2mSp0tg='
WHERE
key_id = '264ed2312c6d854c0a315accdde4887233e014dc878b66b0ce55a8341a9e8faf'
AND (
token = '2xrwv5eTIjv61dEzE1QsacOqtsRP/AFEMiJi2mSp0tg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)