UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uZ8GhPArJtYhdUJwog1EZMaYfcc/+RDmD+CAO5VyuvY='
WHERE
key_id = '28722f7ac95ae47bbd4e387f9467d6acec387c438de353dec319136b0b511b6c'
AND (
token = 'uZ8GhPArJtYhdUJwog1EZMaYfcc/+RDmD+CAO5VyuvY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)