UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '24efrfZNhj5BosolaxXWgQ4VC/B+omYCVhc/D0AWAyo='
WHERE
key_id = '2923361bf9ca606b3b41a0c9f64c9fdb5c8934e21c4c378d34b3972539ce87a1'
AND (
token = '24efrfZNhj5BosolaxXWgQ4VC/B+omYCVhc/D0AWAyo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)