UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Fgf4S5AofPeMGolp6OKoTAVbJG0ifqfB0xGcvo09dQ0='
WHERE
key_id = 'b67362bb041f66116f1390354fe5f4c3aff09a240d78fedde4ce1b69d212bb97'
AND (
token = 'Fgf4S5AofPeMGolp6OKoTAVbJG0ifqfB0xGcvo09dQ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)