UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'O4B8X1qiRedAuKv4iPsqk7AwN/HLFrRjX4ZDMrHu7tk='
WHERE
key_id = '0d64a055cb20b35e7b65d99c4f74a55d3cf0a7fff37893d72aa817e5c8f7d68e'
AND (
token = 'O4B8X1qiRedAuKv4iPsqk7AwN/HLFrRjX4ZDMrHu7tk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)