UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+AdSKKZpnncZ6QvfZjM71UxamENNSB2TOtlp3tAXWv0='
WHERE
key_id = 'a7d4c0cc28f40de2d54733ecb070cb7b23f7ff56565647086a618766b040e60d'
AND (
token = '+AdSKKZpnncZ6QvfZjM71UxamENNSB2TOtlp3tAXWv0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)