UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GSfylM8C+ofPCwIYtfnELXwTghxEOxmtIf/tiWM66FY='
WHERE
key_id = 'a86b8a51da2e4bef2b12604bc6857de52d7853dbea5019c5e405e796bde7a624'
AND (
token = 'GSfylM8C+ofPCwIYtfnELXwTghxEOxmtIf/tiWM66FY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)