UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0Zbsx23KPq7kac31BpzN5Ja/RQzjdyKA6fkFXaS+NXM='
WHERE
key_id = 'd4261ae356a20c4ad2e456cfecf9fae97266c3cfa8aa1ba1d6ba54ceed7d6f7b'
AND (
token = '0Zbsx23KPq7kac31BpzN5Ja/RQzjdyKA6fkFXaS+NXM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)