UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H8lqLKbfVgn67A8adbHirvGe17VrzYps71WadTYsB9k='
WHERE
key_id = '3044f4d365e0a1cd9f485395b1da0b8a559249baf4f654c23aa4b74577844847'
AND (
token = 'H8lqLKbfVgn67A8adbHirvGe17VrzYps71WadTYsB9k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)