UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FDS/yC5rHOM41WOpbdHt5GDEmOJ/cWs3b/bVUnojcJ4='
WHERE
key_id = 'eefd9adc1321826ae17b457a2ebff0402a0b0d721c1c7d3e588879117e80dcb3'
AND (
token = 'FDS/yC5rHOM41WOpbdHt5GDEmOJ/cWs3b/bVUnojcJ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)