UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'e359bFbi8bqsm9ebEcL6mTNmQcyqzH7eDWXJzK3v8aI='
WHERE
key_id = '7bb6855921efac221dcc04e52c3ca0e185f419d1b61e92ad6aacfd3985cc6ac6'
AND (
token = 'e359bFbi8bqsm9ebEcL6mTNmQcyqzH7eDWXJzK3v8aI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)