UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pTuPcBWfI6mkL2S5HUWgzbosJjEwjJfn96V4l1ki2/k='
WHERE
key_id = '0844f4d09095e6f9aec2e93975fdbd7f4ad3baeb451b35739ac19e96bd16a2fb'
AND (
token = 'pTuPcBWfI6mkL2S5HUWgzbosJjEwjJfn96V4l1ki2/k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)