UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oiFaf6M7rF7hl5GVa6CTDgTwYV7qVy1tgDwtX+XrydA='
WHERE
key_id = '2844483c13170e28b61f1e9352604d3ab853c36e614deb2790ef6aa5c18d63a2'
AND (
token = 'oiFaf6M7rF7hl5GVa6CTDgTwYV7qVy1tgDwtX+XrydA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)