UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'czA1Sk/o7uCd9hBwwnjnLjVns/RZ9+jFwQErwjSzMTc='
WHERE
key_id = '24ed33c2222ab9952a3d7aef522755941af36e56ad936116dba831cfe92a2b0c'
AND (
token = 'czA1Sk/o7uCd9hBwwnjnLjVns/RZ9+jFwQErwjSzMTc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)