UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LJ2eaE+ffyLImZssIoMaW2Nt/Hc6fk3kfRftfoK4+3U='
WHERE
key_id = 'b839d31568a5f816fe94623c78e5c0c27e50912836eb3ee31c0e6d50106fa7b8'
AND (
token = 'LJ2eaE+ffyLImZssIoMaW2Nt/Hc6fk3kfRftfoK4+3U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)