UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZVJBhxRirTOOwZVbahMOCb4CGvYOZ3dXczByTDrB6aE='
WHERE
key_id = '1c8da8b130caadc8d04d245e73944a72d1e4af06c1db83274097cbb562ea9615'
AND (
token = 'ZVJBhxRirTOOwZVbahMOCb4CGvYOZ3dXczByTDrB6aE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)