UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bh+2Hr5oB+Gh9+lXO6XgkRWuzKML2kUstJ6AkeeDNzI='
WHERE
key_id = 'f6cf75794e1319410793d0b378b0be16412d605c25124d322cc26323feafe6a0'
AND (
token = 'bh+2Hr5oB+Gh9+lXO6XgkRWuzKML2kUstJ6AkeeDNzI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)