UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kf71mcRw+3mpEeHdFo91ZWlfOZQsy5lg1nchheEHhZs='
WHERE
key_id = 'c78b1125511c13410e9c4175cb8eaaf4c284cc3678a41c0f80b388aa74e48c42'
AND (
token = 'kf71mcRw+3mpEeHdFo91ZWlfOZQsy5lg1nchheEHhZs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)